package d_用户信息.a_用户信息.a_获取插件用户openpid;

import a_接口调用凭证.a_获取接口调用凭据.GetAccessToken;
import my.wechat.rc.common.HttpClientUtil;
import my.wechat.rc.common.MapUtil;

/**
 * @author 86153
 * @date 2022/8/3
 **/
public class GetPluginOpenPId {

    public static GetPluginOpenPIdResponse getPluginOpenPId() {
        try {
            String accessToken = GetAccessToken.getAccessToken().getAccessToken();
            String url = "https://api.weixin.qq.com/wxa/getpluginopenpid?access_token=" + accessToken;
            return HttpClientUtil.post(url, MapUtil.of("code", "c185748f232ce5c34cfe46c280e79210ab6724f0f0778d970867254cd3c2c401"), GetPluginOpenPIdResponse.class);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return new GetPluginOpenPIdResponse();
    }

    public static void main(String[] args) {
        getPluginOpenPId();
    }

    public static class GetPluginOpenPIdResponse {
        private Integer errcode;
        private String errmsg;
        private String openpid;

        public Integer getErrcode() {
            return errcode;
        }

        public void setErrcode(Integer errcode) {
            this.errcode = errcode;
        }

        public String getErrmsg() {
            return errmsg;
        }

        public void setErrmsg(String errmsg) {
            this.errmsg = errmsg;
        }

        public String getOpenpid() {
            return openpid;
        }

        public void setOpenpid(String openpid) {
            this.openpid = openpid;
        }
    }
}
